//
//  LastStageViewCell.m
//  PASystem
//
//  Created by 刘沿 on 16/8/30.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "LastStageViewCell.h"

@implementation LastStageViewCell

+(instancetype)WithLastStageViewCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"LastStageViewCell" owner:nil options:nil] lastObject];
}

- (void)setModel:(LastStageModel *)model{

    _model = model;

    self.NAME.text = model.NAME;
    self.LEADER.text = model.LEADER;
    self.PERSON.text = model.PERSON;
    self.CONTENT.text = model.CONTENT;
    self.FOLLOWPERSON.text = model.FOLLOWPERSON;
    self.FOLLOWSITUATION.text = model.FOLLOWSITUATION;
    
    //时间戳转时间
        NSString *string = model.TIME;
        NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
        fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
        fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
        NSDate *date = [fmt dateFromString:string];
        NSDateFormatter *fm = [[NSDateFormatter alloc] init];
        fm.dateFormat = @"yyyy-MM-dd";
        NSString *selfYear = [fm stringFromDate:date];
    
    self.TIME.text = selfYear;
    
    //时间戳转时间
        NSString *string2 = model.FOLLOWTIME;
        NSDateFormatter *fmt2 = [[NSDateFormatter alloc] init];
        fmt2.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
        fmt2.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
        NSDate *date2 = [fmt2 dateFromString:string2];
        NSDateFormatter *fm2 = [[NSDateFormatter alloc] init];
        fm2.dateFormat = @"yyyy-MM-dd";
        NSString *selfYear2 = [fm2 stringFromDate:date2];
    
    self.FOLLOWTIME.text = selfYear2;
}



@end
